<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
    <script src="echarts.min.js"></script>
    <script src="jquery-1.8.0.min.js"></script>
    <script src="fenshinew.js"></script>
    <script type="text/javascript">
        function myFunc(){
            var data02 =
                [["2015-09-11",16330.4,16433.09,16244.65,16434.76,104630000],["2015-09-14",16450.86,16370.96,16330.87,16450.86,92660000],["2015-09-15",16382.58,16599.85,16382.58,16644.11,93050000],["2015-09-16",16599.51,16739.95,16593.9,16755.98,99620000],["2015-09-17",16738.08,16674.74,16639.93,16933.43,129600000],["2015-09-18",16674.74,16384.58,16343.76,16674.74,341689984],["2015-09-21",16406.1,16510.19,16391.88,16578.6,90730000],["2015-09-22",16477.45,16330.47,16221.73,16477.45,119010000],["2015-09-23",16332.81,16279.89,16211.98,16355.29,86030000],["2015-09-24",16257.11,16201.32,16016.36,16257.11,122220000],["2015-09-25",16205.07,16314.67,16205.07,16465.23,130790000],["2015-09-28",16313.26,16001.89,15981.85,16313.26,139930000],["2015-09-29",16001.76,16049.13,15942.37,16118.89,121160000],["2015-09-30",16057.08,16284.7,16057.08,16297.6,145740000],["2015-10-01",16278.62,16272.01,16073.82,16348.87,111420000],["2015-10-02",16258.25,16472.37,16013.66,16472.77,136890000],["2015-10-05",16502.1,16776.43,16502.1,16798.37,127660000],["2015-10-06",16774.02,16790.19,16746.03,16865.09,120010000],["2015-10-07",16805.42,16912.29,16765,16963.3,115690000],["2015-10-08",16904.17,17050.75,16859.34,17081.28,100730000],["2015-10-09",17054.69,17084.49,17027.23,17110.88,103730000],["2015-10-12",17082.29,17131.86,17064.58,17139.21,72500000],["2015-10-13",17113.55,17081.89,17034.45,17172.81,99400000],["2015-10-14",17079.08,16924.75,16887.67,17111.38,120110000],["2015-10-15",16944.86,17141.75,16933.57,17144.42,122960000],["2015-10-16",17141.75,17215.97,17107.35,17220.02,145880000],["2015-10-19",17209.43,17230.54,17129.19,17235.95,118430000],["2015-10-20",17228.47,17217.11,17147.99,17264.88,106670000],["2015-10-21",17225.93,17168.61,17153.13,17314.99,107100000],["2015-10-22",17180.88,17489.16,17180.88,17505.18,152420000],["2015-10-23",17525.11,17646.7,17525.11,17679.37,158090000],["2015-10-26",17649.57,17623.05,17602.51,17660.7,116660000],["2015-10-27",17608.89,17581.43,17540.57,17635.18,113960000],["2015-10-28",17586.69,17779.52,17556.71,17779.95,115630000],["2015-10-29",17771.5,17755.8,17684.72,17786,90300000],["2015-10-30",17756.6,17663.54,17662.87,17799.96,149250000],["2015-11-02",17672.62,17828.76,17655.02,17845.9,100840000],["2015-11-03",17819.74,17918.15,17796.02,17977.85,92290000],["2015-11-04",17929.58,17867.58,17828.83,17964.12,99890000],["2015-11-05",17871.25,17863.43,17779.19,17929.51,98910000],["2015-11-06",17855.22,17910.33,17768.6,17912.04,107450000],["2015-11-09",17900.78,17730.48,17667.78,17900.78,121210000],["2015-11-10",17724.13,17758.21,17657.72,17768.66,108640000],["2015-11-11",17769.5,17702.22,17696.91,17807.18,95230000],["2015-11-12",17691.93,17448.07,17443.5,17691.93,113660000],["2015-11-13",17439.25,17245.24,17238.89,17439.25,134640000],["2015-11-16",17229.94,17483.01,17210.43,17483.01,137590000],["2015-11-17",17486.99,17489.5,17451.41,17599.33,167190000],["2015-11-18",17485.49,17737.16,17485.49,17752.16,106810000],["2015-11-19",17739.83,17732.75,17681.98,17772.97,114630000],["2015-11-20",17732.75,17823.81,17732.75,17914.34,153140000],["2015-11-23",17823.61,17792.68,17751.53,17868.18,134680000],["2015-11-24",17770.9,17812.19,17683.51,17862.6,127170000],["2015-11-25",17820.81,17813.39,17801.83,17854.92,82540000],["2015-11-27",17806.04,17813.39,17749.32,17830.36,82540000],["2015-11-30",17802.84,17719.92,17719.79,17837.24,155560000],["2015-12-01",17719.72,17888.35,17719.72,17895.5,103880000],["2015-12-02",17883.14,17729.68,17708.2,17901.58,102860000],["2015-12-03",17741.57,17477.67,17425.56,17780.59,126990000],["2015-12-04",17482.68,17847.63,17482.68,17866.47,137650000],["2015-12-07",17845.49,17730.51,17639.25,17845.49,99670000],["2015-12-08",17703.99,17568,17485.39,17703.99,113720000],["2015-12-09",17558.18,17492.3,17403.51,17767.69,122020000],["2015-12-10",17493.17,17574.75,17474.66,17697.74,107310000],["2015-12-11",17574.75,17265.21,17230.5,17574.75,134510000],["2015-12-14",17277.11,17368.5,17138.47,17378.02,142540000],["2015-12-15",17374.78,17524.91,17341.18,17627.63,123430000],["2015-12-16",17530.85,17749.09,17483.68,17784.36,123790000],["2015-12-17",17756.54,17495.84,17493.5,17796.76,115780000],["2015-12-18",17495.04,17128.55,17124.31,17496.58,344560000],["2015-12-21",17154.94,17251.62,17116.73,17272.36,114910000],["2015-12-22",17253.55,17417.27,17242.86,17451.11,91570000],["2015-12-23",17427.63,17602.61,17427.63,17607.92,92820000],["2015-12-24",17593.26,17552.17,17543.95,17606.34,40350000],["2015-12-28",17535.66,17528.27,17437.34,17536.9,59770000],["2015-12-29",17547.37,17720.98,17547.37,17750.02,69860000],["2015-12-30",17711.94,17603.87,17588.87,17714.13,59760000],["2015-12-31",17590.66,17425.03,17421.16,17590.66,93690000],["2016-01-04",17405.48,17148.94,16957.63,17405.48,148060000],["2016-01-05",17147.5,17158.66,17038.61,17195.84,105750000],["2016-01-06",17154.83,16906.51,16817.62,17154.83,120250000],["2016-01-07",16888.36,16514.1,16463.63,16888.36,176240000],["2016-01-08",16519.17,16346.45,16314.57,16651.89,141850000],["2016-01-11",16358.71,16398.57,16232.03,16461.85,127790000],["2016-01-12",16419.11,16516.22,16322.07,16591.35,117480000],["2016-01-13",16526.63,16151.41,16123.2,16593.51,153530000],["2016-01-14",16159.01,16379.05,16075.12,16482.05,158830000],["2016-01-15",16354.33,15988.08,15842.11,16354.33,239210000],["2016-01-19",16009.45,16016.02,15900.25,16171.96,144360000],["2016-01-20",15989.45,15766.74,15450.56,15989.45,191870000],["2016-01-21",15768.87,15882.68,15704.66,16038.59,145140000],["2016-01-22",15921.1,16093.51,15921.1,16136.79,145850000],["2016-01-25",16086.46,15885.22,15880.15,16086.46,123250000],["2016-01-26",15893.16,16167.23,15893.16,16185.79,118210000],["2016-01-27",16168.74,15944.46,15878.3,16235.03,138350000],["2016-01-28",15960.28,16069.64,15863.72,16102.14,130120000],["2016-01-29",16090.26,16466.3,16090.26,16466.3,217940000],["2016-02-01",16453.63,16449.18,16299.47,16510.98,114450000],["2016-02-02",16420.21,16153.54,16108.44,16420.21,126210000],["2016-02-03",16186.2,16336.66,15960.45,16381.69,141870000],["2016-02-04",16329.67,16416.58,16266.16,16485.84,131490000],["2016-02-05",16417.95,16204.97,16129.81,16423.63,139010000],["2016-02-08",16147.51,16027.05,15803.55,16147.51,165880000],["2016-02-09",16005.41,16014.38,15881.11,16136.62,127740000],["2016-02-10",16035.61,15914.74,15899.91,16201.89,122290000],["2016-02-11",15897.82,15660.18,15503.01,15897.82,172070000],["2016-02-12",15691.62,15973.84,15691.62,15974.04,132550000],["2016-02-16",16012.39,16196.41,16012.39,16196.41,142030000],["2016-02-17",16217.98,16453.83,16217.98,16486.12,124080000],["2016-02-18",16483.76,16413.43,16390.43,16511.84,104950000],["2016-02-19",16410.96,16391.99,16278,16410.96,134340000],["2016-02-22",16417.13,16620.66,16417.13,16664.24,102240000],["2016-02-23",16610.39,16431.78,16403.53,16610.39,98170000],["2016-02-24",16418.84,16484.99,16165.86,16507.39,93620000],["2016-02-25",16504.38,16697.29,16458.42,16697.98,94120000],["2016-02-26",16712.7,16639.97,16623.91,16795.98,98480000],["2016-02-29",16634.15,16516.5,16510.4,16726.12,126220000],["2016-03-01",16545.67,16865.08,16545.67,16865.56,105050000],["2016-03-02",16851.17,16899.32,16766.32,16900.17,104470000],["2016-03-03",16896.17,16943.9,16820.73,16944.31,91110000],["2016-03-04",16945,17006.77,16898.84,17062.38,106910000],["2016-03-07",16991.29,17073.95,16940.48,17099.25,100290000],["2016-03-08",17050.67,16964.1,16921.51,17072.79,108380000],["2016-03-09",16969.17,17000.36,16947.94,17048.5,116690000],["2016-03-10",17006.05,16995.13,16821.86,17130.11,117570000],["2016-03-11",17014.99,17213.31,17014.99,17220.09,123420000],["2016-03-14",17207.49,17229.13,17161.16,17275.07,96350000],["2016-03-15",17217.15,17251.53,17120.35,17251.7,92830000],["2016-03-16",17249.34,17325.76,17204.07,17379.18,118710000],["2016-03-17",17321.38,17481.49,17297.65,17529.01,117990000],["2016-03-18",17481.49,17602.3,17481.49,17620.58,321230016],["2016-03-21",17589.7,17623.87,17551.28,17644.97,84410000],["2016-03-22",17602.71,17582.57,17540.42,17648.94,95450000],["2016-03-23",17588.81,17502.59,17486.27,17588.81,84240000],["2016-03-24",17485.33,17515.73,17399.01,17517.14,84100000],["2016-03-28",17526.08,17535.39,17493.03,17583.81,70460000],["2016-03-29",17512.58,17633.11,17434.27,17642.81,86160000],["2016-03-30",17652.36,17716.66,17652.36,17790.11,79330000],["2016-03-31",17716.05,17685.09,17669.72,17755.7,102600000],["2016-04-01",17661.74,17792.75,17568.02,17811.48,104890000],["2016-04-04",17799.39,17737,17710.67,17806.38,85230000],["2016-04-05",17718.03,17603.32,17579.56,17718.03,115230000],["2016-04-06",17605.45,17716.05,17542.54,17723.55,99410000],["2016-04-07",17687.28,17541.96,17484.23,17687.28,90120000],["2016-04-08",17555.39,17576.96,17528.16,17694.51,79990000],["2016-04-11",17586.48,17556.41,17555.9,17731.63,107100000],["2016-04-12",17571.34,17721.25,17553.57,17744.43,81020000],["2016-04-13",17741.66,17908.28,17741.66,17918.35,91710000],["2016-04-14",17912.25,17926.43,17885.44,17962.14,84510000],["2016-04-15",17925.95,17897.46,17867.41,17937.65,118160000],["2016-04-18",17890.2,18004.16,17848.22,18009.53,89390000],["2016-04-19",18012.1,18053.6,17984.43,18103.46,89820000],["2016-04-20",18059.49,18096.27,18031.21,18167.63,100210000],["2016-04-21",18092.84,17982.52,17963.89,18107.29,102720000],["2016-04-22",17985.05,18003.75,17909.89,18026.85,134120000],["2016-04-25",17990.94,17977.24,17855.55,17990.94,83770000],["2016-04-26",17987.38,17990.32,17934.17,18043.77,92570000],["2016-04-27",17996.14,18041.55,17920.26,18084.66,109090000],["2016-04-28",18023.88,17830.76,17796.55,18035.73,100920000],["2016-04-29",17813.09,17773.64,17651.98,17814.83,136670000],["2016-05-02",17783.78,17891.16,17773.71,17912.35,80100000],["2016-05-03",17870.75,17750.91,17670.88,17870.75,97060000],["2016-05-04",17735.02,17651.26,17609.01,17738.06,95020000],["2016-05-05",17664.48,17660.71,17615.82,17736.11,81530000],["2016-05-06",17650.3,17740.63,17580.38,17744.54,80020000],["2016-05-09",17743.85,17705.91,17668.38,17783.16,85590000],["2016-05-10",17726.66,17928.35,17726.66,17934.61,75790000],["2016-05-11",17919.03,17711.12,17711.05,17919.03,87390000],["2016-05-12",17711.12,17720.5,17625.38,17798.19,88560000],["2016-05-13",17711.12,17535.32,17512.48,17734.74,86640000],["2016-05-16",17531.76,17710.71,17531.76,17755.8,88440000],["2016-05-17",17701.46,17529.98,17469.92,17701.46,103260000],["2016-05-18",17501.28,17526.62,17418.21,17636.22,79120000],["2016-05-19",17514.16,17435.4,17331.07,17514.16,95530000],["2016-05-20",17437.32,17500.94,17437.32,17571.75,111990000],["2016-05-23",17507.04,17492.93,17480.05,17550.7,87790000],["2016-05-24",17525.19,17706.05,17525.19,17742.59,86480000],["2016-05-25",17735.09,17851.51,17735.09,17891.71,79180000],["2016-05-26",17859.52,17828.29,17803.82,17888.66,68940000],["2016-05-27",17826.85,17873.22,17824.73,17873.22,73190000],["2016-05-31",17891.5,17787.2,17724.03,17899.24,147390000],["2016-06-01",17754.55,17789.67,17664.79,17809.18,78530000],["2016-06-02",17789.05,17838.56,17703.55,17838.56,75560000],["2016-06-03",17799.8,17807.06,17689.68,17833.17,82270000],["2016-06-06",17825.69,17920.33,17822.81,17949.68,71870000],["2016-06-07",17936.22,17938.28,17936.22,18003.23,78750000],["2016-06-08",17931.91,18005.05,17931.91,18016,71260000],["2016-06-09",17969.98,17985.19,17915.88,18005.22,69690000],["2016-06-10",17938.82,17865.34,17812.34,17938.82,90540000],["2016-06-13",17830.5,17732.48,17731.35,17893.28,101690000],["2016-06-14",17710.77,17674.82,17595.79,17733.92,93740000],["2016-06-15",17703.65,17640.17,17629.01,17762.96,94130000],["2016-06-16",17602.23,17733.1,17471.29,17754.91,91950000],["2016-06-17",17733.44,17675.16,17602.78,17733.44,248680000],["2016-06-20",17736.87,17804.87,17736.87,17946.36,99380000],["2016-06-21",17827.33,17829.73,17799.8,17877.84,85130000],["2016-06-22",17832.67,17780.83,17770.36,17920.16,89440000]];
            var data2 = "";
            for(var i = 0;i<data02.length;i++){
                data2 = data2+";";
                for(var j = 0;j<data02[i].length;j++){
                    data2 = data2+data02[i][j]+",";
                }
            }
            // 基于准备好的dom，初始化echarts实例
//            var myChart = echarts.init(document.getElementById('main'));
//            myChart.setOption(getOption(), true);
            managerHistory(data2);
            myChart = echarts.init(document.getElementById('main'),'auto');
            myChart.setOption(getOption(true));
        }
        //处理数据，绘制图形
        //        function myFun() {
        //            //请求k线历史数据
        //            $.post("http://192.168.0.109/gppz/index.php/Home/Index/historyKline",{kline:"0"},function(data){
        //                if(data !=''){
        //                    //处理获取到的历史数据
        //                    managerHistory(data);
        //                    myChart = echarts.init(document.getElementById('main'));
        //                    // 使用刚指定的配置项和数据显示图表。
        //                    myChart.setOption(getOption(true));
        //                    //添加计时器,请求实时数据
        ////                    timer = self.setInterval("timedCount()",2000);
        //                }
        //            });
        ////            managerHistory(data2);
        ////            myChart = echarts.init(document.getElementById('main'));
        ////            myChart.setOption(getOption());
        //        }
        //添加计时器,请求实时数据
        function timedCount()
        {
            $.post("http://121.43.171.137:65530/gppz/index.php/Home/Index/Kline",{kline:"0"},function(data){
                if(data !=''){
                    setData(data);
                    if(drawBool){
                        myChart.setOption(getOption(false));
                    }
                }
            });
        }
        function onClick(){

        }
    </script>
</head>
<body onload="myFunc()" >
<!--<div style="width: 500px;height: 300px;">-->
<div id="main" style="width: 1285px;height:650px;background-color: #27262E"></div>
<!--</div>-->
<!--<div id="main" style="width: 800px;height:500px;background-color: #27262E"></div>-->
<!--<div id="main" style="width:100%;height:100%;background-color: #27262E" onclick="onClick()"></div>-->
<!--<img src="2.png" style="width: 100%;"/>-->
</body>
</html>